package com.oyo.common.enums;

/**
 * @Author: sangbowei
 * @Description:
 * @Date: 2018/9/1 11:37
 */
public enum OperationCode {
    CHECK_IN(0, "入住"),

    CHECK_OUT(1, "离店"),

    ARRANGE_ROOM(2, "排房"),

    OFF(3, "停售"),

    OPEN(4, "可售"),

    DIRTY(5, "设置为脏房"),

    CLEAN(6, "设置为干净房"),

    TO_CLEAN(7, "设置为去打扫"),

    HAD_CLEAN(8, "设置为已打扫");
    int code;
    String name;

    OperationCode(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(int code) {
        OperationCode[] types = values();
        for (OperationCode type : types) {
            if (type.getCode() == code) {
                return type.getName();
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}

